def main():
    numbers = []

    while True:
        user_input = input("请输入一个数字（输入'bye'结束）：")

        if user_input.lower() == 'bye':
            break

        try:
            number = int(user_input)
            numbers.append(number)
        except ValueError:
            print("请输入一个有效的整数或'bye'结束。")

    if numbers:
        total_sum = sum(numbers)
        average = total_sum / len(numbers)
        max_value = max(numbers)
        min_value = min(numbers)

        print(f"总和: {total_sum}")
        print(f"平均值: {average}")
        print(f"最大值: {max_value}")
        print(f"最小值: {min_value}")
    else:
        print("没有输入任何数字。")


if __name__ == "__main__":
    main()
